home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / nfss-addons / nfsslint.sty < prev    next >
Text File  |  1992-05-22  |  3KB  |  94 lines

  1. %%% ====================================================================
  2. %%%  @LaTeX-style-file{
  3. %%%     author          = "Mario Wolczko",
  4. %%%     version         = "2",
  5. %%%     date            = "21 May 1992",
  6. %%%     time            = "20:59:01 BST",
  7. %%%     filename        = "nfsslint.sty",
  8. %%%     address         = "Dept of Computer Science
  9. %%%                        The University of Manchester
  10. %%%                        Oxford Road
  11. %%%                        Manchester M13 9PL
  12. %%%                        UK",
  13. %%%     telephone       = "+44-61-275-6146",
  14. %%%     FAX             = "+44-61-275-6236",
  15. %%%     checksum        = "25494 93 315 3067",
  16. %%%     email           = "mario@cs.man.ac.uk (Internet)",
  17. %%%     codetable       = "ISO/ASCII",
  18. %%%     keywords        = "LaTeX, NFSS, fonts",
  19. %%%     supported       = "yes",
  20. %%%     docstring       = "For New Font Selection Scheme users --
  21. %%%     warns of possible font problems in pre-NFSS files.",
  22. %%%  }
  23. %%% ====================================================================
  24. %
  25. % If you have switched to the NFSS, but have pre-NFSS documents, this
  26. % style option will tell you when latexing those documents using NFSS
  27. % may change the appearance.
  28. %
  29. % Example: if in a document you had
  30. %    \bf foo \sf bar
  31. % then prior to NFSS ``bar'' would be in mediumweight sans-serif, but
  32. % using NFSS it would be in bold sans.  If you add nfsslint as a style
  33. % option, you will get a warning something like this:
  34. %  nfsslint: possible unexpected font in use of \sf on line 42
  35.  
  36. \@ifundefined{extract@font}
  37.      {\@warning{The style option `nfsslint' is ignored
  38.          -- you are not using the new font selection scheme.}
  39.       \endinput}
  40.      {}
  41.  
  42. \let\@prelint@tt\tt
  43. \let\@prelint@rm\rm
  44. \let\@prelint@sf\sf
  45. \let\@prelint@sc\sc
  46. \let\@prelint@it\it
  47. \let\@prelint@bf\bf
  48. \let\@prelint@sl\sl
  49.  
  50. \def\@lintwarn#1{\@warning{nfsslint: possible unexpected font in use
  51.     of \string#1}}
  52.  
  53. % warn if not default series and shape
  54. \def\rm{%
  55.   \ifx\f@series\default@series % series OK
  56.     \ifx\f@shape\default@shape\else\@lintwarn\rm\fi
  57.   \else\@lintwarn\rm\fi
  58.   \@prelint@rm}
  59. \def\sf{%
  60.   \ifx\f@series\default@series % series OK
  61.     \ifx\f@shape\default@shape\else\@lintwarn\sf\fi
  62.   \else\@lintwarn\sf\fi
  63.   \@prelint@sf}
  64. \def\tt{%
  65.   \ifx\f@series\default@series % series OK
  66.     \ifx\f@shape\default@shape\else\@lintwarn\tt\fi
  67.   \else\@lintwarn\tt\fi
  68.   \@prelint@tt}
  69.  
  70. % warn if not default family and shape
  71. \def\bf{%
  72.   \ifx\f@family\default@family % family OK
  73.     \ifx\f@shape\default@shape\else\@lintwarn\bf\fi
  74.   \else\@lintwarn\bf\fi
  75.   \@prelint@bf}
  76.  
  77.  
  78. % warn if not default family and series
  79. \def\it{%
  80.   \ifx\f@family\default@family % family OK
  81.     \ifx\f@series\default@series\else\@lintwarn\it\fi
  82.   \else\@lintwarn\it\fi
  83.   \@prelint@it}
  84. \def\sl{%
  85.   \ifx\f@family\default@family % family OK
  86.     \ifx\f@series\default@series\else\@lintwarn\sl\fi
  87.   \else\@lintwarn\sl\fi
  88.   \@prelint@sl}
  89. \def\sc{%
  90.   \ifx\f@family\default@family % family OK
  91.     \ifx\f@series\default@series\else\@lintwarn\sc\fi
  92.   \else\@lintwarn\sc\fi
  93.   \@prelint@sc}
  94.